import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import routers from './route'

// function App() {
//   const handleClick1 = () => {
//     Toast.success('成功的提示～～', 3)
//   }

//   const handleClick2 = () => {
//     Toast.fail('失败的提示～～', 3)
//   }
//   return (
//     <div>
//       <Button type="primary" onClick={handleClick1}>
//         primary
//       </Button>
//       <Button type="warning" onClick={handleClick2}>
//         warning
//       </Button>
//     </div>
//   )
// }

function App() {
  return (
    <Router>
      <Switch>
        {routers.map((route) => {
          // return <Route path={route.path} component={route.component} key={route.path}/>
          return <Route 
          {...route}
          key={route.path}
          exact
          />
        })}
      </Switch>
    </Router>
  )
}

export default App
